//
//  HeadCollectionReusableView.m
//  礼物说
//
//  Created by dllo on 16/4/26.
//  Copyright © 2016年 sunzhichao. All rights reserved.
//

#import "HeadCollectionReusableView.h"
#import "StrategyBeforeModel.h"

@interface HeadCollectionReusableView ()

@property (nonatomic ,retain) BaseLabel *label;
@property (nonatomic ,assign) NSInteger number;

@end

@implementation HeadCollectionReusableView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        [self createHeadView];
    }
    return self;
}
- (void)dealloc{
    
    [_label release];
    [_str release];
    [_model release];
    [super dealloc];
}
- (void)setStr:(NSString *)str{
    if (_str != str) {
        [_str release];
        _str = [str retain];
    }
    self.label.text = _str;
}
- (void)setModel:(StrategyBeforeModel *)model{
    
    if (_model != model) {
        [_model release];
        _model = [model retain];
    }
    self.label.text = _model.name;
    
}
- (void)createHeadView{
    
    self.label = [[BaseLabel alloc]init];
    [self addSubview:_label];
    [_label release];
    
    _label.frame = CGRectMake(kWIDTHS(5), kWIDTHS(5), kWIDTHS(100), self.frame.size.height - kWIDTHS(2));
//    _label.backgroundColor = [UIColor greenColor];
}

@end
